package cn.gqr.mapper;

import cn.gqr.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {

    //查询该用户全部购物车
    List<CartBook> findAll(@Param("uid")int uid);

    //添加order
    int addOrder(Order order);

    //添加ordItem
    int addOrderItem(@Param("orditem")OrderItem orditem);

    //加入购物车
    int addCart(Cart cart);

    //根据uid和bookid查找并添加
    int updByUidBookId(@Param("uid")int uid, @Param("bookid")int bookid);

    //删除购物车
    int delByUidBookId(@Param("uid")int uid,@Param("bookid")int bookid);

    //删除购物车
    int delById(@Param("id")int id);

}
